package br.com.vti.sisp_sicrim.antigo.controller.relatorios;

import java.io.FileNotFoundException;
import java.text.ParseException;

import net.sf.jasperreports.engine.JRException;
import br.com.caelum.vraptor.Result;
import br.com.vti.sisp_sicrim.antigo.model.SicCadastro;
import br.com.vti.sisp_sicrim.antigo.model.SicSenha;
import br.com.vti.sisp_sicrim.antigo.util.Relatorios;
import br.com.vti.sisp_sicrim.antigo.util.Sessao;

/**
 * Classe responsavel por encapsular o tratamento e as consistencias da tela
 * Scrp1610Report
 * 
 * @author Incode - Data: mai/2014
 * 
 */
public class Scrp1610Report {
	private String horaCorrente;
	private Result result;
	private Sessao sessao;
	private Relatorios report;
	// Classes views
	SicCadastro criminalView = new SicCadastro();
	SicSenha senhaView = new SicSenha(); // Classes includes

	public Scrp1610Report() throws JRException {
		inicializar();
	}

	public Scrp1610Report(Sessao sessao) throws JRException {
		this.sessao = sessao;
		inicializar();
	}

	public void inicializar() throws JRException {
		report = new Relatorios();
		report.setNumeroRel(1, "D");
		{
			report.setNumeroLinhaRel(4, 2);
			{
				report.adicionaCampo(0, 1, "lit_0_1", "C", "", "-");
				report.adicionaCampo(69, 9, "lit_69_9", "C", "", "PRODAMAR-");
				report.setFimLinhaRel();
			}
		}
	}

	public boolean validar() {
		// validar os campos recebidos da tela
		return true;
	}

	public void setPageSize(int pagesize) throws JRException {
		report.setPageSize(pagesize);
	}

	public void setLineSize(int linesize) {
		report.setLineSize(linesize);
	}

	public int getPageSize() {
		return report.getPageSize();
	}

	public int getPageLine() {
		return report.getPageLine();
	}

	public void saltaLinhas(int qtdLinhas) throws ParseException, JRException {
		report.saltaLinhas(qtdLinhas);
	}

	public void gravaRelatorio(int nroRel) throws ParseException, JRException {
		report.gravaRelatorio(report, nroRel, false);
	}

	public void imprimir() throws FileNotFoundException, JRException {
		report.imprimir();
	}
}
